package bupt.zsd.CSV;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class RandomLabel {
	static int count = 1179;

	public static void main(String[] args) {
		int[] label = new int[count];
		for(int i=0;i<count;i++)
			label[i]=0;
		StringBuilder sb = new StringBuilder();
		File file1 = new File("D:\\PaperW\\result", "labelrandom.txt");
		for (int i = 0; i < count; i++) {
			if (Math.random() >= 0.7)
				label[i] = 1;
			sb.append(label[i]);
			if (i != label.length - 1)
				sb.append(' ');
		}
		try {
			FileWriter fw = new FileWriter(file1, true);
			fw.write(sb.toString());
			fw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
